package com.example.buttomnavigationapplication.base;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import butterknife.ButterKnife;

public abstract class BaseFragment extends Fragment {
    private Context mcontext;
    private View mview;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mcontext=getContext();
        mview=inflater.inflate(getLayoutResource(),container,false);
        ButterKnife.bind(this,mview);
        initDate();
        return mview;
    }

    /**
     * 初始化
     */
    protected abstract void initDate();

    /**
     * 布局
     */
    protected abstract int getLayoutResource();

}
